package ar.com.ctrln.view.dashboard.calendar;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.VariableResolver;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Button;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Window;

import ar.com.ctrln.control.calendar.RegistrarEvento;
import ar.com.ctrln.persistence.model.evento.EventoCalendario;
import ar.com.ctrln.persistence.model.evento.Participante;
import ar.com.ctrln.view.ui.comportamientoVentana.AbstractMinimizarVentana;

@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class)
public class ConsultarParticipantesController extends AbstractMinimizarVentana {

	private static final long serialVersionUID = -1418433063824478373L;

	@WireVariable
	private RegistrarEvento registrarEvento;

	@Wire
	private Window wConsultarParticipantes;

	@Wire
	private Listbox listaContactos;

	@Wire
	private Button bAgregarParticipantes;

	@Wire
	private Button bImprimirListado;

	private EventoCalendario evento;

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);

		evento = registrarEvento.getEvento();
		listaContactos.setModel(new ListModelList<Participante>(evento
				.getParticipantes()));

	}

	@Listen("onClick = #bAgregarParticipantes")
	public void cerrar() {
		wConsultarParticipantes.onClose();
	}

	@Listen("onClick = #bAgregarParticipantes")
	public void bImprimirListado() {

	}
}
